home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2004 May / SGI IRIX 6.5 Applications 2004 May.iso / dist / java3d.idb / usr / demos / java / j3d / programs / examples / GeometryCompression / obj2cg.java.z / obj2cg.java
Encoding:
Java Source  |  2003-08-08  |  2.4 KB  |  67 lines

  1. /*
  2.  *    @(#)obj2cg.java 1.8 02/04/01 15:03:57
  3.  *
  4.  * Copyright (c) 1996-2002 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Redistribution and use in source and binary forms, with or without
  7.  * modification, are permitted provided that the following conditions
  8.  * are met:
  9.  *
  10.  * - Redistributions of source code must retain the above copyright
  11.  *   notice, this list of conditions and the following disclaimer.
  12.  *
  13.  * - Redistribution in binary form must reproduce the above copyright
  14.  *   notice, this list of conditions and the following disclaimer in
  15.  *   the documentation and/or other materials provided with the
  16.  *   distribution.
  17.  *
  18.  * Neither the name of Sun Microsystems, Inc. or the names of
  19.  * contributors may be used to endorse or promote products derived
  20.  * from this software without specific prior written permission.
  21.  *
  22.  * This software is provided "AS IS," without a warranty of any
  23.  * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
  24.  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
  25.  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
  26.  * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
  27.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  28.  * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
  29.  * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
  30.  * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
  31.  * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
  32.  * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
  33.  * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  34.  *
  35.  * You acknowledge that Software is not designed,licensed or intended
  36.  * for use in the design, construction, operation or maintenance of
  37.  * any nuclear facility.
  38.  */
  39.  
  40. import com.sun.j3d.utils.compression.* ;
  41. import javax.media.j3d.* ;
  42. import java.io.* ;
  43.  
  44. class obj2cg {
  45.  
  46.     public static void main(String args[]) throws IOException {
  47.     if (args.length < 2) {
  48.         System.out.println
  49.         ("obj2cg wants the names of .obj files to compress,\n" +
  50.          "followed by the name of a .cg file to create or to\n" +
  51.          "which to append.") ;
  52.         System.exit(0) ;
  53.     }
  54.  
  55.     CompressedGeometryFile file ;
  56.     file = new CompressedGeometryFile(args[args.length-1], true) ;
  57.  
  58.     ObjectFileCompressor compressor ;
  59.     compressor = new ObjectFileCompressor() ;
  60.  
  61.     for (int i = 0 ; i < args.length-1 ; i++)
  62.         compressor.compress(args[i], file) ;
  63.  
  64.     file.close() ;
  65.     }
  66. }
  67.